package cn.webestar.scms.user.entity;

import cn.webestar.scms.commons.entity.BasicDO;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.util.Date;

@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@TableName(value = "t_user", autoResultMap = true)
@Schema(name = "User", description = "用户")
public class User extends BasicDO<Long> {

    @TableField("name")
    @Schema(description = "名称")
    private String name;

    @TableField("gender")
    @Schema(description = "性别，0：未知，1：男，2：女")
    private Integer gender;

    @TableField("avatar_url")
    @Schema(description = "头像")
    private String avatarUrl;

    @TableField("phone_num")
    @Schema(description = "手机号码")
    private String phoneNum;

    @TableField("username")
    @Schema(description = "用户名")
    private String username;

    @TableField("pwd")
    @Schema(description = "密码")
    private String pwd;

    @TableField("status")
    @Schema(description = "状态，1：正常")
    private Integer status;

    @TableField("regtime")
    @Schema(description = "注册时间")
    private Date regtime;

    @TableField("last_login_time")
    @Schema(description = "最后登录时间")
    private Date lastLoginTime;

    @TableField("creator")
    @Schema(description = "创建人")
    private Long creator;

    @TableField("updater")
    @Schema(description = "更新人")
    private Long updater;

    @TableField("deleter")
    @Schema(description = "删除人")
    private Long deleter;

    @TableField("create_time")
    @Schema(description = "创建时间")
    private Date createTime;

    @TableField("update_time")
    @Schema(description = "更新时间")
    private Date updateTime;

    @TableField("delete_time")
    @Schema(description = "删除时间")
    private Date deleteTime;

    @TableLogic(value = "false", delval = "true")
    @TableField("is_deleted")
    @Schema(description = "是否已删除")
    private Boolean isDeleted;

}